SELECT c.PARAMETER_ID
<#if parameterTypes ??><#list parameterTypes as t>
	,MAX(DECODE(c.PARAMETERTYPE_ID, ${t.id}, c.value)) AS PT${t.id}
</#list></#if>  
  FROM C_PARAMETERPOOL c WHERE c.OBJECT_ID=:objectId and c.OBJECTTYPE=:objectType
 GROUP BY c.PARAMETER_ID